package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_against;

//DAO
public interface U_againstMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_AGAINST  WHERE ID = #{id}")
	public ApiU_against findU_againstById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_against")
	public List<ApiU_against> findU_againsts();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_againstsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_AGAINST (CONN_ID, TYPE, AGAINST_UID, AGAINST_UNAME, ADD_TIME, REASON,status) VALUES (#{conn_id}, #{type}, #{against_uid}, #{against_uname}, #{add_time}, #{reason},#{status})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertU_against(ApiU_against u_against);

	// 修改
	@Update("UPDATE U_AGAINST SET CONN_ID = #{conn_id}, TYPE = #{type}, AGAINST_UID = #{against_uid}, AGAINST_UNAME = #{against_uname}, "
			+ "ADD_TIME = #{add_time}, REASON = #{reason}, status = #{status}, handermsg = #{handermsg}, update_time = #{update_time} WHERE ID = #{id}")
	public int updateU_against(ApiU_against u_against);

	// 删除
	@Delete("DELETE FROM U_AGAINST  WHERE ID = #{id}")
	public int deleteU_against(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
